package com.itheima.travel.utils;

import java.util.ResourceBundle;

public class ServiceFactory {
    private static ResourceBundle bundle;
    static {
         bundle = ResourceBundle.getBundle("service");
    }
   public static Object getService(String id){
       String serviceName = bundle.getString(id);
       Object obj = null;
       try {
           obj = Class.forName(serviceName).newInstance();
       } catch (Exception e) {
           e.printStackTrace();
       }
       return obj;
   }


}
